package com.atguigu.crowd.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.atguigu.crowd.entity.Menu;
import com.atguigu.crowd.entity.MenuExample;
import com.atguigu.crowd.entity.Tag;
import com.atguigu.crowd.entity.TagExample;
import com.atguigu.crowd.mapper.MenuMapper;
import com.atguigu.crowd.mapper.TagMapper;
import com.atguigu.crowd.service.api.MenuService;
import com.atguigu.crowd.service.api.TagService;

@Service
public class TagServiceImpl implements TagService {

	@Autowired
	private TagMapper tagMapper;
	
	@Override
	public List<Tag> getAll() {
		return tagMapper.selectByExample(new TagExample());
	}

	@Override
	public void saveTag(Tag tag) {
		tagMapper.insert(tag);
	}

	@Override
	public void updateTag(Tag tag) {
		tagMapper.updateByPrimaryKeySelective(tag);
	}

	@Override
	public void removeTag(Integer id) {
		tagMapper.deleteByPrimaryKey(id);
	}

	@Override
	public void addProjectTag(Tag tag) {
		tagMapper.insert(tag);
	}

	@Override
	public void editProjectTag(Tag tag) {
		tagMapper.updateByPrimaryKeySelective(tag);
	}

	@Override
	public void removeProjectTag(Integer id) {
		tagMapper.deleteByPrimaryKey(id);
	}

}
